﻿using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using VaccinationHost.Model;
using VaccinationHost.Model.Dto;
using VaccinationHost.Services;

namespace VaccinationHost.Controllers
{
    /// <summary>
    /// 疫苗控制器
    /// </summary>
    [Route("api/vaccine")]
    [Authorize]
    [ApiController]
    public class VaccineController : ControllerBase
    {
        private IVaccineService _vaccineService;

        public VaccineController(IVaccineService vaccineService)
        {
            _vaccineService = vaccineService;
        }

        /// <summary>
        /// 获取疫苗信息
        /// </summary>
        /// <returns></returns>
        [Route("getvaccines")]
        [HttpGet]
        public async Task<List<VaccineDto>> GetVaccines()
        {
            return await _vaccineService.GetVaccines();
        }

    }
}
